package fucai.com.fucai.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.List;

/**
 * Created by itte on 2015/12/17.
 */
public class SildingPagerAdapter extends FragmentStatePagerAdapter {

    private List<Fragment> lists;
    private String[] titlsName;

    public SildingPagerAdapter(FragmentManager fm, List<Fragment> lists, String[] titlsName) {
        super(fm);
        this.lists = lists;
        this.titlsName = titlsName;
    }

    @Override
    public Fragment getItem(int position) {
        return lists.get(position);
    }

    @Override
    public int getCount() {
        return lists.size();
    }
    @Override
    public CharSequence getPageTitle(int position) {
        return titlsName[position];
    }
}
